<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:d="http://java.sun.com/jsf/composite/dip"
	xmlns:func="http://dip.com.br/functions">
<h:head>
	<title></title>
</h:head>
<h:body>
	<ui:composition template="../tpt/tpt.xhtml">
		<ui:define name="head">
		Cadastro UF
	</ui:define>
		<ui:define name="conteudo">
			<f:view>

				<h:form name="formCadUF" id="formCadUF" prependId="false">
					<h:panelGroup id="cadCorpo" layout="block">
						<p:messages showDetail="true" autoUpdate="true" />
						<d:managerPopUp id="listagemUF"
							urlPopUp="../listagem/listagemUF.xhtml"
							manageBean="#{cadastroUF}" ouvinteRendered=":formCadUF:cadCorpo"
							height="420" width="550" title="Listagem UF"
							popUpName="popUF" />
						<table>
							<tr>
								<td>
									UF:
								</td>
								<td>
									<p:inputText value="#{cadastroUF.uf.descricao}" />
								</td>
								<td>
									<p:commandButton value="Pesquisar" update="cadCorpo" action="#{cadastroUF.mostrarListagemUF}"/>
								</td>
							</tr>
							<tr>
								<td>
									Sigla:
								</td>
								<td colspan="2">
									<p:inputText value="#{cadastroUF.uf.sigla}" />
								</td>
							</tr>
						</table>
						<h:panelGroup id="barra" layout="block">
							<p:commandButton value="Salvar" update="#{func:getFooClientId('cadCorpo')}"
								action="#{cadastroUF.acaoInserir}"
								disabled="#{cadastroUF.uf.id!=null}" />
							<p:commandButton value="Alterar" update="#{func:getFooClientId('cadCorpo')}"
								disabled="#{cadastroUF.uf.id==null}" 
								action="#{cadastroUF.acaoAlterar}" />
							<p:commandButton value="Excluir" update="#{func:getFooClientId('cadCorpo')}"
								disabled="#{cadastroUF.uf.id==null}" 
								action="#{cadastroUF.acaoRemover}" />
							<p:commandButton value="Limpar" update="#{func:getFooClientId('cadCorpo')}"
								action="#{cadastroUF.acaoLimpar}" />


						</h:panelGroup>

					</h:panelGroup>
				</h:form>

			</f:view>
		</ui:define>
	</ui:composition>
</h:body>
</html>
